package Supermercado.Pruebas.Menus;

import DepositoMIDlet;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

import Supermercado.Pruebas.FechaForm;
import Supermercado.Pruebas.Listas.ListaExclusiva;
import Supermercado.Pruebas.Listas.ListaImplicita;
import Supermercado.Pruebas.Listas.ListaMultiple;

public class MenuListas extends List implements CommandListener {
	
	private Command volver = new Command("volver", Command.SCREEN, 0);
	
	public MenuListas() {
		 super("Menu listas", List.IMPLICIT);
	        append("Exclusiva", null);
	        append("Implicita", null);
	        append("Multiple", null);
	        append("Fecha", null);
	        addCommand(volver);
	        setCommandListener(this);
		
	}

	
	public void commandAction(Command c, Displayable arg1) {
        if(c == volver){
//        	DepositoMIDlet.midlet.backApp(0);
        }
        if (c == List.SELECT_COMMAND) {
            int index = getSelectedIndex();
            switch (index) {
                case 0:
                    DepositoMIDlet.midlet.display.setCurrent(new ListaExclusiva("Lista Exclusiva"));
                    break;
                case 1:
                    DepositoMIDlet.midlet.display.setCurrent(new ListaImplicita("Lista Implisita"));
                    break;
                case 2:
                    DepositoMIDlet.midlet.display.setCurrent(new ListaMultiple("Lista Multiple"));
                    break;
                case 3:
                    DepositoMIDlet.midlet.display.setCurrent(new FechaForm("Formulario Fecha"));
                    break;               
            }
        }
    }
	

}
